﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MyMVCApplication
{
    public static class ExtensionMethods
    {
       public static TagBuilder FluentTextBox(this HtmlHelper htmlHelper,string name, string value)
       {
           var tagBuilder = new TagBuilder("input");
           tagBuilder.Attributes["name"] = name;
           tagBuilder.Attributes["id"] = name;
           tagBuilder.Attributes["value"] = value;
           return tagBuilder; 
       }

        public static TagBuilder OnFocus(this TagBuilder tagBuilder, string script)
        {
            tagBuilder.MergeAttribute("onfocus",script);
            return tagBuilder; 
        }

        public static TagBuilder OnBlur(this TagBuilder tagBuilder, string script)
        {
            tagBuilder.MergeAttribute("onblur",script);
            return tagBuilder; 
        }

    }
}
